package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.ShareLinkMapper;
import com.brainhealth.customer.domain.ShareLink;
import com.brainhealth.customer.service.IShareLinkService;

/**
 * 分享链接Service业务层处理
 * 
 * @author wolong
 * @date 2023-06-07
 */
@Service
public class ShareLinkServiceImpl implements IShareLinkService 
{
    @Autowired
    private ShareLinkMapper shareLinkMapper;

    /**
     * 查询分享链接
     * 
     * @param shareLinkId 分享链接主键
     * @return 分享链接
     */
    @Override
    public ShareLink selectShareLinkByShareLinkId(Long shareLinkId)
    {
        return shareLinkMapper.selectShareLinkByShareLinkId(shareLinkId);
    }

    /**
     * 查询分享链接列表
     * 
     * @param shareLink 分享链接
     * @return 分享链接
     */
    @Override
    public List<ShareLink> selectShareLinkList(ShareLink shareLink)
    {
        return shareLinkMapper.selectShareLinkList(shareLink);
    }

    /**
     * 新增分享链接
     * 
     * @param shareLink 分享链接
     * @return 结果
     */
    @Override
    public int insertShareLink(ShareLink shareLink)
    {
        shareLink.setCreateTime(DateUtils.getNowDate());
        return shareLinkMapper.insertShareLink(shareLink);
    }

    /**
     * 修改分享链接
     * 
     * @param shareLink 分享链接
     * @return 结果
     */
    @Override
    public int updateShareLink(ShareLink shareLink)
    {
        shareLink.setUpdateTime(DateUtils.getNowDate());
        return shareLinkMapper.updateShareLink(shareLink);
    }

    /**
     * 批量删除分享链接
     * 
     * @param shareLinkIds 需要删除的分享链接主键
     * @return 结果
     */
    @Override
    public int deleteShareLinkByShareLinkIds(Long[] shareLinkIds)
    {
        return shareLinkMapper.deleteShareLinkByShareLinkIds(shareLinkIds);
    }

    /**
     * 删除分享链接信息
     * 
     * @param shareLinkId 分享链接主键
     * @return 结果
     */
    @Override
    public int deleteShareLinkByShareLinkId(Long shareLinkId)
    {
        return shareLinkMapper.deleteShareLinkByShareLinkId(shareLinkId);
    }
}
